package br.com.domain;

import java.util.ArrayList;
import java.util.List;


public class Menu extends Domain {
	
	/**************************************************************************/
	/**                                ATRIBUTOS                             **/
	/**************************************************************************/

	private static final long serialVersionUID = 1L;
	
	private Integer id;		
	private String nome;	
	private String icon;
	private List<MenuItem> listMenuItem = new ArrayList<MenuItem>();
	
	/**************************************************************************/
	/**                              GET's E SET's                           **/
	/**************************************************************************/
	public Integer getId() {
		return id;
	}
	public List<MenuItem> getListMenuItem() {
		return listMenuItem;
	}
	public void setListMenuItem(List<MenuItem> listMenuItem) {
		this.listMenuItem = listMenuItem;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	/********************************************************************/
	/**                EQUALS E HASH CODE  - RETIRAR LIST's            **/
	/********************************************************************/

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((listMenuItem == null) ? 0 : listMenuItem.hashCode());
		result = prime * result + ((nome == null) ? 0 : nome.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Menu other = (Menu) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (listMenuItem == null) {
			if (other.listMenuItem != null)
				return false;
		} else if (!listMenuItem.equals(other.listMenuItem))
			return false;
		if (nome == null) {
			if (other.nome != null)
				return false;
		} else if (!nome.equals(other.nome))
			return false;
		return true;
	}
	
	
	
}
